package com.sf.obserable;

import java.util.Observable;
import java.util.Observer;

/**
 * @author 埔枘
 * @date 2019/12/04
 **/
public class Teacher implements Observer {

    private String name;

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public void update(Observable o, Object arg) {
        Iky iky = (Iky)o;
        Question question = (Question)arg;
        System.out.println(this.name + "老师你好,您收到一个消息，内容:"+question.getContent()+"---来自于:"+iky.getName());
    }
}
